/******************************************************************************
* File description: OpenFileLocateFileUploadWebAdd.qml
* Function: 打开：本地文件-网络文件添加
* Current Version: 1.0.0
* Author: 张宇轩
* Date: 2024-08-31
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14

Item {
    id: root

    /* property 定义开始 */

    // 信号
    signal cancel()
    /* property 定义结束 */

    ColumnLayout {
        id: locateFileLayout
        anchors.fill: parent

        // 主内容
        Item {
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.leftMargin: 24
            Layout.rightMargin: 24
            Layout.topMargin: 15

            ColumnLayout {
                anchors.fill: parent
                spacing: 16

                // ip地址
                LabelTextInput {
                    id: ipAddr
                    Layout.fillWidth: true
                    Layout.preferredHeight: 40
                    inputWidth: width
                    inputHeight: height
                    labelText: "IP地址"

                    Component.onCompleted: {
                        ipAddr.setLabelSize(username.getLabelSize()[0], undefined)
                    }
                }

                // 用户名
                LabelTextInput {
                    id: username
                    Layout.fillWidth: true
                    Layout.preferredHeight: 40
                    inputWidth: width
                    inputHeight: height
                    labelText: "用户名"
                }

                // 密码
                LabelTextInput {
                    id: pwd
                    Layout.fillWidth: true
                    Layout.preferredHeight: 40
                    inputWidth: width
                    inputHeight: height
                    labelText: "密    码"

                    Component.onCompleted: {
                        pwd.setLabelSize(username.getLabelSize()[0], undefined)
                    }
                }

            }
        }

        // 底部按钮部分
        Item {
            id: bottomBtnsCon
            Layout.fillWidth: true
            Layout.preferredHeight: 40
            Layout.bottomMargin: 40
            Layout.topMargin: 40

            RowLayout {
                anchors.fill: parent

                CustomHorSpacerItem {}

                // 取消
                PureButton {
                    id: cancelbtn
                    Layout.preferredWidth: 120
                    Layout.preferredHeight: 40
                    pureText: "取消"
                    // 关闭过渡效果
                    isTransition: false

                    onReleased: {
                        root.cancel()
                    }
                }

                // 连接
                PureButton {
                    id: uploadBtn
                    Layout.preferredWidth: 120
                    Layout.preferredHeight: 40
                    pureBtnColor: "#FF2F42CD"
                    pureHoveredColor: "#FF2F42CD"
                    pureLabelColor: "#FFFFFFFF"
                    pureFontHoveredColor: "#FFFFFFFF"
                    pureBtnBorderColor: "transparent"
                    pureText: "连接"
                    // 关闭过渡效果
                    isTransition: false
                }

                CustomHorSpacerItem {}
            }
        }
    }
}
